package com.tencent.compose.sample.mainpage.material3

import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import org.jetbrains.compose.ui.tooling.preview.Preview


@Preview()
@Composable
internal fun SurfaceDemo() {
    // 状态变量委托正常工作（依赖上面导入的 getValue/setValue）
    var count by remember { mutableStateOf(0) }
    // Surface 组件可正常识别（依赖上面导入的 Surface）
    Surface(
        onClick = { count++ } // 点击时自增计数，语法正常
    ) {
        Text("Clickable Surface. Count: $count")
    }
}